import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { NewProjectComponent } from '../new-project/new-project.component';
import { InviteComponent } from '../invite/invite.component';

@Component({
  selector: 'app-project-list',
  templateUrl: './project-list.component.html',
  styleUrls: ['./project-list.component.scss']
})
export class ProjectListComponent implements OnInit {

  projects = [{
    "name": "企业协作平台",
    "desc": "这是一个企业内部项目",
    "coverImg": "assets/img/covers/0.jpg"
  }, {
    "name": "企业协作平台",
    "desc": "这是一个企业内部项目",
    "coverImg": "assets/img/covers/1.jpg"
  }];

  constructor(private dialog: MatDialog) { }

  ngOnInit() {
  }

  // 打开对话框
  openNewProjectDialog() {
    const dialogRef = this.dialog.open(NewProjectComponent, {
      data: {
        dark: true
      }
    });
  }

  // 接收邀请按钮点击事件并作处理
  LaunchInviteDialog() {
    const dialogRef = this.dialog.open(InviteComponent);
  }
}
